!% -SD !Inheritance, by Michael Thomét (cobalt) !Created for Interactive Fiction Writing Month !Week One Submission !v .1 !This work is licensed under a Creative Commons Attribution-Noncommercial 3.0 United States License. !======================================= Constant Story "Inheritance"; Constant Headline "^Inheritance By Michael Thomét^"; Include "Parser"; Include "VerbLib"; !======================================= ! Game Objects !Cabin Room and Objects Object front_of_cabin "Front of The Caldwell Cabin" with description "You are standing on the wooden porch of The Caldwell Cabin, a cabin in the woods built by your great grandfather. The porch is made of a wood that has a glossy, silver sheen. The remainder of the cabin is made of large stones that have been mortared together with cement. The door to the cabin was once a bright red, but time has faded the paint and more of the silvery wood peeks through where the paint has peeled. A pair of lamps frame the door, giving off a yellow glow. The effect makes it seem like the door is the gaping mouth of a flat-faced incect.^ ^A path leads south into the forest, while a fork leads off and joins the mountain road.", s_to in_woods, n_to d_cabin_lobby, in_to d_cabin_lobby, e_to side_cabin_e, w_to side_cabin_w, has ; Object front_cabin_light "pair of lamps" front_of_cabin with description "The lamps are attached to the brick with black pipes, plain and undecorated. Each bulb is surrounded with clear glass which almost seems more suitable for drinking than lighing. These lamps emit a soft yellow glow that remind you of the lights that lined the highway on the way to the cabin. Small insects form a cloud around the glass that covers the bulbs.", name 'lamp' 'lamps' 'pair' 'bulb' 'bulbs' 'light' 'lights' 'glow', before [; Take: print_ret "The lamps are functioning fine and are firmly attached to the brick."; ], each_turn [; if(self in front_of_cabin) give self light; give self ~light;], has scenery; Object front_cabin_porch "porch" front_of_cabin with description "The porch sits in front of the door to the cabin, not more than a few strides across. The wood has a silver sheen to it, as if the wood were old, but the planks seem somewhat new, and in good shape. The porch sags a bit in the middle, where a little water has collected. Above, the wood glistens with drops from a recent rain. Three short steps lead to a path going into the woods.", name 'porch' 'wood' 'silver' 'glossy' 'sheen' 'wooden' 'steps', has scenery; Object front_cabin_cabin "cabin" front_of_cabin with description "The Place of Refuge is a stone cabin, built by your great grandfather, Augustus Caldwell. It is made of large, grey stones, giving the cabin a bumpy exterior. The unfinished stones make the cabin look almost like a natural part of the landscape. The only windows are on the second floor, but are too thick and worn to see into the rooms. The wooden porch looks far newer than the cabin itself. The stonework having collected leaves, branches, mud and the occasional abandoned bird nest.", name 'cabin' 'place' 'caldwell' 'building' 'lodge', before [; Enter: <>; ], has scenery; !Woods room and Objects Object in_woods "In the woods" with description "The path leads a short way into a copse of trees before fading beneath fallen leaves. The path could have gone further, but the moutain face looms a short distance away. The woods are quiet and still. Mosses cover the exposed dirt and creep up the wiry trees. A groove in the forest floor looks as though, at one time, a stream had flowed here. The sun pokes through the trees.", n_to front_of_cabin, has ; Object sun "sun" with description "The sun flickers behind the leaves.", name 'sun' 'light', before [; Take: print_ret "You try to pluck the sun from the sky and destroy all life on Earth, but your efforts are to no avail; the sun is just too far away."; ], found_in in_woods front_of_cabin side_cabin_w side_cabin_e cabin_rear, has light scenery; Object woods_trees "trees" in_woods with description "The trees are like wires, stretching high into the sky, bent at sharp angles. The bark is grey, with splotches of white rot forming on the tops of some of the branches. The branches are stripped of leaves, haven fallen to the forest floor.", name 'tree' 'trees' has scenery; Object lobby "The Lobby of The Caldwell Cabin" with description, s_to d_cabin_lobby, out_to d_cabin_lobby, e_to d_lobby_office, w_to d_lobby_dining, u_to hallway, has light; !REMOVE! Object dining_hall "Dining Hall" with description, e_to d_lobby_dining, n_to d_dining_kitchen, has light; !REMOVE! Object kitchen "Kitchen" with description, s_to d_dining_kitchen, w_to d_kitchen_pantry, has light; !REMOVE! Object pantry "Pantry" with description, e_to d_kitchen_pantry, has light; !REMOVE! Object cellar "Cellar" with description, has ; Object hidden_room "A Room Behind the Wall" with description, has ; Object office "Office" with description, w_to d_lobby_office, has light; !REMOVE! Object hallway "Second Floor Hallway" with description, d_to lobby, se_to d_room_1, sw_to d_room_2, w_to d_room_4, e_to d_room_5, nw_to d_room_6, ne_to d_hallway_bathroom, has light; !REMOVE! Object room_1 "Room 1" with description, w_to d_room_1, has light; Object room_2 "Room 2" with description, e_to d_room_2, has ; Object room_3 "room 3" hallway with description "There isn't a Room Number 3", name 'room' '3//' 'three', before [; Examine:; default: "You can't do anything with a non-existant room."; ], has scenery concealed; Object room_4 "Room 4" with description, e_to d_room_4, has ; Object room_5 "Room 5" with description, w_to d_room_5, has ; Object room_6 "Room 6" with description, e_to d_room_6, has ; Object bathroom "Bathroom" with description, w_to d_hallway_bathroom, has ; Object side_cabin_w "Side of Cabin" with description, s_to front_of_cabin, n_to cabin_rear, has ; Object side_cabin_e "Side of Cabin" with description, s_to front_of_cabin, n_to cabin_rear, has ; Object cabin_rear "Behind Cabin" with description, e_to side_cabin_e, w_to side_cabin_w, has ; !DOORS Object d_cabin_lobby "front door" with description, name 'front' 'door', when_closed "The front door is closed.", when_open "The front door is open.", door_to [; if (self in front_of_cabin) return lobby; return front_of_cabin; ], door_dir [; if (self in front_of_cabin) return n_to; return s_to; ], found_in lobby front_of_cabin, before [; Enter: if (self in front_of_cabin) <>; "You're already inside."; Exit: if (self in front_of_cabin) "You're already outside."; <>; Go: if (self hasnt open) print_ret (The) noun, " is closed."; ], has door scenery openable; Object d_lobby_dining "dining hall doors" with description, name 'dining' 'hall' 'doors//p', when_closed "The doors are closed.", when_open "The doors are open.", door_to [; if (self in dining_hall) return lobby; return dining_hall; ], door_dir [; if (self in dining_hall) return e_to; return w_to; ], before [; Enter: if (self in lobby) <>; "You're already inside."; Exit: if (self in lobby) "You're already outside."; <>; Go: if (self hasnt open) print_ret (The) noun, " are closed."; ], found_in lobby dining_hall, has door scenery openable pluralname; Object d_lobby_office "office door" with description, name 'office' 'door', when_closed "The office door is closed.", when_open "The office door is open.", door_to [; if (self in office) return lobby; return office; ], door_dir [; if (self in office) return w_to; return e_to; ], before [; Enter: if (self in lobby) <>; "You're already inside."; Exit: if (self in lobby) "You're already outside."; <>; Go: if (self hasnt open) print_ret (The) noun, " is closed."; ], found_in lobby office, has door scenery openable; Object d_dining_kitchen "kitchen door" with description, name 'kitchen' 'door', when_closed "The kitchen door is closed.", when_open "The kitchen door is open.", door_to [; if (self in kitchen) return dining_hall; return kitchen; ], door_dir [; if (self in kitchen) return s_to; return n_to; ], before [; Enter: if (self in dining_hall) <>; "You're already inside."; Exit: if (self in dining_hall) "You're already outside."; <>; Go: if (self hasnt open) print_ret (The) noun, " is closed."; ], found_in dining_hall kitchen, has door scenery openable; Object d_kitchen_pantry "thin door" with description, name 'thin' 'pantry' 'door', when_closed "The thin door is closed.", when_open "The thin door is open.", door_to [; if (self in kitchen) return pantry; return kitchen; ], door_dir [; if (self in kitchen) return w_to; return e_to; ], before [; Enter: if (self in kitchen) <>; "You're already inside."; Exit: if (self in kitchen) "You're already outside."; <>; Go: if (self hasnt open) print_ret (The) noun, " is closed."; ], found_in kitchen pantry, has door scenery openable; Object d_room_1 "door to room 1" with description, name 'room' '1//' 'one' 'to' 'door', when_closed "The door to room 1 is closed.", when_open "The door to room 1 is open.", door_to [; if (self in hallway) return room_1; return hallway; ], door_dir [; if (self in room_1) return w_to; return se_to; ], before [; Enter: if (self in hallway) <>; "You're already inside."; Exit: if (self in hallway) "You're already outside."; <>; Go: if (self hasnt open) print_ret (The) noun, " is closed."; ], found_in hallway room_1, has door scenery openable; Object d_room_2 "door to room 2" with description, name 'room' '2//' 'two' 'to' 'door', when_closed "The door to room 2 is closed.", when_open "The door to room 2 is open.", door_to [; if (self in hallway) return room_2; return hallway; ], door_dir [; if (self in room_2) return e_to; return sw_to; ], before [; Enter: if (self in hallway) <>; "You're already inside."; Exit: if (self in hallway) "You're already outside."; <>; Go: if (self hasnt open) print_ret (The) noun, " is closed."; ], found_in hallway room_2, has door scenery openable; Object d_room_4 "door to room 4" with description, name 'room' '4//' 'four' 'to' 'door', when_closed "The door to room 4 is closed.", when_open "The door to room 4 is open.", door_to [; if (self in hallway) return room_4; return hallway; ], door_dir [; if (self in room_4) return e_to; return w_to; ], before [; Enter: if (self in hallway) <>; "You're already inside."; Exit: if (self in hallway) "You're already outside."; <>; Go: if (self hasnt open) print_ret (The) noun, " is closed."; ], found_in hallway room_4, has door scenery openable; Object d_room_5 "door to room 5" with description, name 'room' '5//' 'five' 'to' 'door', when_closed "The door to room 5 is closed.", when_open "The door to room 5 is open.", door_to [; if (self in hallway) return room_5; return hallway; ], door_dir [; if (self in room_5) return w_to; return e_to; ], before [; Enter: if (self in hallway) <>; "You're already inside."; Exit: if (self in hallway) "You're already outside."; <>; Go: if (self hasnt open) print_ret (The) noun, " is closed."; ], found_in hallway room_5, has door scenery openable; Object d_room_6 "door to room 6" with description, name 'room' '6//' 'six' 'to' 'door', when_closed "The door to room 6 is closed.", when_open "The door to room 6 is open.", door_to [; if (self in hallway) return room_6; return hallway; ], door_dir [; if (self in room_6) return e_to; return nw_to; ], before [; Enter: if (self in hallway) <>; "You're already inside."; Exit: if (self in hallway) "You're already outside."; <>; Go: if (self hasnt open) print_ret (The) noun, " is closed."; ], found_in hallway room_6, has door scenery openable; Object d_hallway_bathroom "door to the bathroom" with description, name 'bathroom' 'to' 'door', when_closed "The door to the bathroom is closed.", when_open "The door to the bathroom is open.", door_to [; if (self in hallway) return bathroom; return hallway; ], door_dir [; if (self in bathroom) return e_to; return ne_to; ], before [; Enter: if (self in hallway) <>; "You're already inside."; Exit: if (self in hallway) "You're already outside."; <>; Go: if (self hasnt open) print_ret (The) noun, " is closed."; ], found_in hallway bathroom, has door scenery openable; ! PLAYER Object newplayer "yourself" with description [; print_ret "Shawn Morgan: ", !Random description follows. (string) random("Sower of library fines.", "Tiding of disillusionment.", "Pet peeve of pet peeves everywhere."); ], capacity 3, blackout false, time 0, weather 0, max_size 10, holding 0, react_before [; Take: !A complicated new way to take objects! All for size-based capacity. if(noun has static or scenery or door or visited or animate) rfalse; if(noun in location && noun provides size){ if(noun.size > self.max_size) print_ret (The) noun, "is far too massive to pick up."; if(self.holding + noun.size > self.max_size) print_ret "You are already holding too much to be able to pick up ", (the) noun; if(self.holding > self.max_size / 2) print_ret "Both of your hands are already full."; move noun to self; self.holding = self.holding + noun.size; if(noun.size > self.max_size / 2) "You pick up ", (the) noun, " with both hands."; "You pick up ", (the) noun, " with one hand."; } Drop: !A deceptively simple addition to dropping things. if(noun in self && noun provides size){ self.holding = self.holding - noun.size; rfalse; } ], has concealed animate proper transparent; Object purse "purse" !The grandmother of all purses, this purse holds based on size. with description "A medium-sized, faux leather purse with a wide shoulder strap. Black.", max_size 15, holding 0, size 0, !The purse doesn't have a size. This is just to make things really easy. single_item_too_large 7, react_before [; Insert: !A maximum of 15-sized objects can fit in the bag. I also added a restriction to !individual items with a size of more than 7, so players can't put rakes in the !purse, even if they can pick them up. The numbers will change, probably, so I !made them into variables. if(noun in newplayer && noun provides size){ if(noun.size > self.max_size) print_ret "You can't even pick up ", (the) noun, ", let alone put it in your purse!"; if(noun.size > self.single_item_too_large) print_ret "Try as you might, ", (the) noun, " just won't fit in your purse."; if(self.holding + noun.size > self.max_size) print_ret "Your purse has too much in it without adding ", (the) noun, "."; self.holding = self.holding + noun.size; newplayer.holding = newplayer.holding - noun.size; move noun to self; "You put ", (the) noun, " in your purse."; } Remove: !I'm pretty sure some of these lines are redundant. if(noun in purse && purse in newplayer && noun provides size){ if(newplayer.holding + noun.size > newplayer.max_size / 2 && newplayer.holding > newplayer.max_size / 2) "You're currently holding something that requires two hands. You'll have to drop if before you can take anything from your purse."; if(newplayer.holding + noun.size > newplayer.max_size) "Your hands are full. You'll have to drop something first."; if(newplayer.holding <= newplayer.max_size / 2 && noun.size > newplayer.max_size) print_ret "You'll need two hands to carry ", (the) noun, ", but you're holding something already."; move noun to newplayer; self.holding = self.holding - noun.size; newplayer.holding = newplayer.holding + noun.size; print_ret "You take ", (the) noun, " out of your purse."; } Disrobe: !Even without a size, the purse is counted as an object held in the hand when you stop !wearing it. if(newplayer.holding > newplayer.max_size / 2) print_ret "Both of your hands are already full."; ], name 'purse' 'faux' 'leather' 'black' 'faux-leather' 'bag' 'handbag' 'hand' 'medium' 'medium-sized' 'sized' 'sack', has container clothing openable; Object letter "Letter of Substitution" with description "This is the letter your father wrote you, authorizing you to accept his inheritance instead of him. It is addressed to a Ryan Ash, and has been stamped and signed by a notary.", name 'letter' 'of' 'substitution' 'stamped', size 1, has ; !======================================= ! Entry Point Routines [ Initialise; Intro(); move newplayer to front_of_cabin; ChangePlayer(newplayer); move purse to newplayer; give purse worn; move letter to purse; purse.holding = 1; location = front_of_cabin; ]; !======================================= ! Various Other Routines [ Intro; print "~What do you mean, 'You're not going?'~ you say to your father.^ ~Shawn,~ your father says, ~I'd rather let the others fight over themselves.~^ ~Great Grandpa had money, didn't he?~ you say.^ ~I don't want any of it if it means being shut up with them,~ your father says.^ ~I'll go then,~ you say.^ ~Like mother like daughter.~"; print "^^--Press any key to continue.--^"; @read_char 1 -> sp; @erase_window -1; print "You've just driven for two hours into the mountains on a two-lane highway that you're not sure has ever been repaved since it was laid down. You're looking at a dirt road from the cab of your truck, stopped in the middle of the empty highway. The directions had said to turn down this road. You sigh and turn on your blinker. Then you turn it off again. It's not like anyone can see it.^^ After a quarter mile down a bumpy road at ten miles an hour, a stone cabin looms at the top of a hill. You park the truck next to a small, dusty sedan at the base of the hill and get out. Following an old dirt path, you arrive at the front of the cabin."; print "^^--Press any key to continue.--^"; @read_char 1 -> sp; @erase_window -1; print "~I'll write you a letter,~ he had said."; print "^^--Press any key to continue.--^"; @read_char 1 -> sp; @erase_window -1; ]; !======================================= ! Grammars Include "Grammar"; !=======================================